3.966 \(\int (1-x)^n x^3 (1+x)^{-n} \, dx\)

Optimal. Leaf size=105 \[ \frac{2^{-n} n \left (n^2+2\right ) (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac{1-x}{2}\right )}{3 (n+1)}-\frac{1}{12} (1-x)^{n+1} \left (2 n^2-2 n x+3\right ) (x+1)^{1-n}-\frac{1}{4} x^2 (1-x)^{n+1} (x+1)^{1-n} \]

[Out]

-((1 - x)^(1 + n)*x^2*(1 + x)^(1 - n))/4 - ((1 - x)^(1 + n)*(1 + x)^(1 - n)*(3 +
 2*n^2 - 2*n*x))/12 + (n*(2 + n^2)*(1 - x)^(1 + n)*Hypergeometric2F1[n, 1 + n, 2
 + n, (1 - x)/2])/(3*2^n*(1 + n))

_______________________________________________________________________________________

Rubi [A]  time = 0.184701, antiderivative size = 105, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167 \[ \frac{2^{-n} n \left (n^2+2\right ) (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac{1-x}{2}\right )}{3 (n+1)}-\frac{1}{12} (1-x)^{n+1} \left (2 n^2-2 n x+3\right ) (x+1)^{1-n}-\frac{1}{4} x^2 (1-x)^{n+1} (x+1)^{1-n} \]

Antiderivative was successfully verified.

[In]  Int[((1 - x)^n*x^3)/(1 + x)^n,x]

[Out]

-((1 - x)^(1 + n)*x^2*(1 + x)^(1 - n))/4 - ((1 - x)^(1 + n)*(1 + x)^(1 - n)*(3 +
 2*n^2 - 2*n*x))/12 + (n*(2 + n^2)*(1 - x)^(1 + n)*Hypergeometric2F1[n, 1 + n, 2
 + n, (1 - x)/2])/(3*2^n*(1 + n))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 11.058, size = 82, normalized size = 0.78 \[ - \frac{2^{n} n \left (n^{2} + 2\right ) \left (x + 1\right )^{- n + 1}{{}_{2}F_{1}\left (\begin{matrix} - n, - n + 1 \\ - n + 2 \end{matrix}\middle |{\frac{x}{2} + \frac{1}{2}} \right )}}{3 \left (- n + 1\right )} - \frac{x^{2} \left (- x + 1\right )^{n + 1} \left (x + 1\right )^{- n + 1}}{4} - \frac{\left (- x + 1\right )^{n + 1} \left (x + 1\right )^{- n + 1} \left (4 n^{2} - 4 n x + 6\right )}{24} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((1-x)**n*x**3/((1+x)**n),x)

[Out]

-2**n*n*(n**2 + 2)*(x + 1)**(-n + 1)*hyper((-n, -n + 1), (-n + 2,), x/2 + 1/2)/(
3*(-n + 1)) - x**2*(-x + 1)**(n + 1)*(x + 1)**(-n + 1)/4 - (-x + 1)**(n + 1)*(x
+ 1)**(-n + 1)*(4*n**2 - 4*n*x + 6)/24

_______________________________________________________________________________________

Mathematica [C]  time = 0.172932, size = 79, normalized size = 0.75 \[ \frac{5 x^4 (1-x)^n (x+1)^{-n} F_1(4;-n,n;5;x,-x)}{4 (5 F_1(4;-n,n;5;x,-x)-n x (F_1(5;1-n,n;6;x,-x)+F_1(5;-n,n+1;6;x,-x)))} \]

Warning: Unable to verify antiderivative.

[In]  Integrate[((1 - x)^n*x^3)/(1 + x)^n,x]

[Out]

(5*(1 - x)^n*x^4*AppellF1[4, -n, n, 5, x, -x])/(4*(1 + x)^n*(5*AppellF1[4, -n, n
, 5, x, -x] - n*x*(AppellF1[5, 1 - n, n, 6, x, -x] + AppellF1[5, -n, 1 + n, 6, x
, -x])))

_______________________________________________________________________________________

Maple [F]  time = 0.098, size = 0, normalized size = 0. \[ \int{\frac{ \left ( 1-x \right ) ^{n}{x}^{3}}{ \left ( 1+x \right ) ^{n}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((1-x)^n*x^3/((1+x)^n),x)

[Out]

int((1-x)^n*x^3/((1+x)^n),x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int{\left (x + 1\right )}^{-n} x^{3}{\left (-x + 1\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^3*(-x + 1)^n/(x + 1)^n,x, algorithm="maxima")

[Out]

integrate((x + 1)^(-n)*x^3*(-x + 1)^n, x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{x^{3}{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^3*(-x + 1)^n/(x + 1)^n,x, algorithm="fricas")

[Out]

integral(x^3*(-x + 1)^n/(x + 1)^n, x)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((1-x)**n*x**3/((1+x)**n),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{x^{3}{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^3*(-x + 1)^n/(x + 1)^n,x, algorithm="giac")

[Out]

integrate(x^3*(-x + 1)^n/(x + 1)^n, x)